#include <string.h>
#include "fstring.h"

int split(char **arr, char *str, const char *del) 
{
	int c = 0;
	char *s = (char*)strtok(str, del);
	while(s != NULL) {
		*arr++ = s;
		s = (char*)strtok(NULL, del);
		c ++;
	}
	return c;
}
int split_r(char **arr, char *str, const char *del) 
{
	char *saveptr;
	int c = 0;
	char *s = (char*)strtok_r(str, del, &saveptr);
	while(s != NULL) {
		*arr++ = s;
		s = (char*)strtok_r(NULL, del, &saveptr);
		c ++;
	}
	return c;
}

